package ipt.pru.f4;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class RegistroF4 {

	private long tsInicio;
	private long tsFin;
	private String typeColection;
	
	
	public long getTsInicio() {
		return tsInicio;
	}


	public void setTsInicio(long tsInicio) {
		this.tsInicio = tsInicio;
	}


	public long getTsFin() {
		return tsFin;
	}


	public void setTsFin(long tsFin) {
		this.tsFin = tsFin;
	}


	public String getTypeColection() {
		return typeColection;
	}


	public void setTypeColection(String typeColection) {
		this.typeColection = typeColection;
	}

	public void logGenerator() {
		FileWriter flS=null;
		BufferedWriter fS=null;

		try {
			flS=new FileWriter("LogF4.txt", true);
			fS=new BufferedWriter(flS);
			fS.write(String.valueOf(tsInicio)+","+String.valueOf(tsFin)+","+String.valueOf(tsFin-tsInicio)+","+typeColection);
			fS.newLine();
			
			
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			if (fS != null){
				try {
					fS.close();
					flS.close();
				} catch (IOException e) {
				
					e.printStackTrace();
				}
				
			}
		}
		
	}


}
